#include <iostream>
#include "string.h"
using namespace std;

string &string::operator=(const string &str){
  if(this!=&str){
    delete []m_data;
    m_data=new char[str.size()+1];
    strcpy(m_data,str.m_data);
  }
  return *this;
}

string &string::operator=(const char *s){
  delete []m_data;
  m_data=new char[strlen(s)+1];
  strcpy(m_data,s);
  return *this;
}


